let x = [1, 2, 3, 4, 5]

let y = [3, 4, 5, 6, 7]

let z = y.filter(item => !x.includes(item))

let arr = [...x, ...z]

console.log(arr);